#include <iostream>
#include <string>
using namespace std;

struct Student
{
    double score;
};

struct People
{
    string name;
    int age;
    struct  Student student;
};

//结构体嵌套结构体
void qiantaojiegouti()
{
    //创建子结构体变量
    struct Student s = {99.5};
    People p1 = {"张三",18,s};
    People p2 = {"张起灵",18,{79.5}};

    cout<<"姓名："<<p1.name<<"，年龄："<<p1.age<<"成绩："<<p1.student.score<<endl;
    cout<<"姓名："<<p2.name<<"，年龄："<<p2.age<<"成绩："<<p2.student.score;
}
